<?php
class Show extends CI_Model {
	function __construct() {
		parent :: __construct();
	}
	function show_info($id) {
		$sql = "select * from info where id =" . $id;
		$query = $this->db->query($sql);
		return $query->row();
	}
	function getLists($pageindex = 0, $pagesize = 10, $types) {
		$sql = "select * from " . $this->db->dbprefix('info') . " where class_id = " . $types;
		$sql .= " order by id desc limit ?,? ";
		$query = $this->db->query($sql, array (
			$pageindex,
			$pagesize
		));
		return $query->result();
	}
	function getCount($types) {
		$query = $this->db->query("select count(id) as count from " . $this->db->dbprefix('info') . " where class_id = " . $types);
		$row = $query->row();
		return $row->count;
	}
	function hang ($pageindex = 0, $pagesize = 10, $types){
		$sql = "select * from " . $this->db->dbprefix('hang') . " where class = " . $types;
		$sql .= " order by id desc limit ?,? ";
		$query = $this->db->query($sql, array (
			$pageindex,
			$pagesize
		));
		return $query->result();
	}
}